<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Function</title>
  <script>
      window.color = "red";
      let o = {color: "blue"}

      function sayColor() {
          alert(this.color);
      }

      sayColor(); //red
      sayColor.call(this);//red 显式的指定 sayColor函数体内的this为window
      // sayColor.call(o);//blue 指定sayColor函数体内的this为o，此时执行环境已经不是window了

      let sayColor2 = sayColor.bind(o);
      sayColor2();//blue

  </script>
</head>
<body>
apply() 和call() 方法
</body>
</html>